<template>
    <div >
                    <el-switch
            v-model="value"
            @change="change"
            active-color="#13ce66"
            inactive-color="#ff4949">
            </el-switch>

    </div>
</template>

<script>
import {approveStatus} from '@/api/novel'
    export default {
        props:['scope'],
        data() {
            return {
                value:false
            }
        },
        created() {
            // console.log( "上线状态",this.$props.scope.row.approveStatus);
              this.value = this.$props.scope.row.approveStatus == 1 
        },
       methods: {
       async change(){
             console.log(this.$props.scope.row.id,this.value);
             await approveStatus( {  id: this.$props.scope.row.id , approveStatus :this.value })
        }   
       },
    }
</script>

<style lang="scss" scoped>

</style>